<?php

namespace Admin\Controller;

//use Think\Controller;

class MessageController extends ExtendController {

    //显示栏目
    public function index(){
     $list = D('Message')->field('a.*,b.url')->alias('a')->order('createtime DESC')->join("left join ki_img  b on a.id = b.id")->select();
       $this->assign('list',$list);
        $this->display(); // 输出模板
    }
   
    //删除
    public function delete() {
        $imagesModel = M('Message');
        $map['m_id'] = $_GET['id'];
        $result = $imagesModel->where($map)->delete();
        if ($result != false) {
            $this->redirect('News/index');
        } else {
            $this->error('删除失败!');
        }
    }
}